<?php
	if (isset($_POST['facebookid'])) {
		
		$facebookid = "fb_".$_POST['facebookid'];
		
		require_once __DIR__ . '/db_connect.php';;

		$db = new DB_CONNECT();

		$results = mysql_query(" SELECT id, last_question, album_id, ruby
								FROM user
								WHERE username = '".$facebookid."' ") or die(mysql_error());

		$list = mysql_fetch_row($results);

		if ( mysql_num_rows($results) > 0) {
			$id					= $list[0];
			$lastquestion 		= $list[1];
			$albumid 			= $list[2];
			$ruby			= $list[3];
			print_r($id."|".$lastquestion."|".$albumid."|".$ruby);	
		} else	
			echo 1;	
	} else
		echo 0;
?>